package com.project.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.OrderBean;
import com.project.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("order")
public class IOrderController {
    @Autowired
    private IOrderService orderService;
    @RequestMapping("addOrder")
    public void addOrder(@RequestParam("userName") String userName,
                         @RequestParam("movieName") String movieName,
                         @RequestParam("seriesNum") String seriesNum,
                         @RequestParam("cinema") String cinema,
                         @RequestParam("row") String row,
                         @RequestParam("seat") Integer seat){
        orderService.addOrder(new OrderBean(userName, movieName, seriesNum,cinema,row, seat));
    }
    @RequestMapping("getOrderAll")
    public List<OrderBean> getOrderAll(@RequestParam("userName") String userName) {
        return orderService.getOrderAll(userName);
    }
}
